home *** CD-ROM | disk | FTP | other *** search
- package sun.print;
-
- import java.awt.GridBagConstraints;
- import java.awt.GridBagLayout;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import javax.print.attribute.standard.Sides;
- import javax.swing.BorderFactory;
- import javax.swing.ButtonGroup;
- import javax.swing.JPanel;
-
- class ServiceDialog$SidesPanel extends JPanel implements ActionListener {
- private final String strTitle;
- private ServiceDialog.IconRadioButton rbOneSide;
- private ServiceDialog.IconRadioButton rbTumble;
- private ServiceDialog.IconRadioButton rbDuplex;
- // $FF: synthetic field
- final ServiceDialog this$0;
-
- public ServiceDialog$SidesPanel(ServiceDialog var1) {
- this.this$0 = var1;
- this.strTitle = ServiceDialog.getMsg("border.sides");
- GridBagLayout var2 = new GridBagLayout();
- GridBagConstraints var3 = new GridBagConstraints();
- this.setLayout(var2);
- this.setBorder(BorderFactory.createTitledBorder(this.strTitle));
- var3.fill = 1;
- var3.insets = ServiceDialog.access$700();
- var3.weighty = (double)1.0F;
- var3.gridwidth = 0;
- ButtonGroup var4 = new ButtonGroup();
- this.rbOneSide = new ServiceDialog.IconRadioButton(var1, "radiobutton.oneside", "oneside.png", true, var4, this);
- this.rbOneSide.addActionListener(this);
- ServiceDialog.access$300(this.rbOneSide, this, var2, var3);
- this.rbTumble = new ServiceDialog.IconRadioButton(var1, "radiobutton.tumble", "tumble.png", false, var4, this);
- this.rbTumble.addActionListener(this);
- ServiceDialog.access$300(this.rbTumble, this, var2, var3);
- this.rbDuplex = new ServiceDialog.IconRadioButton(var1, "radiobutton.duplex", "duplex.png", false, var4, this);
- this.rbDuplex.addActionListener(this);
- var3.gridwidth = 0;
- ServiceDialog.access$300(this.rbDuplex, this, var2, var3);
- }
-
- public void actionPerformed(ActionEvent var1) {
- Object var2 = var1.getSource();
- if (this.rbOneSide.isSameAs(var2)) {
- ServiceDialog.access$1200(this.this$0).add(Sides.ONE_SIDED);
- } else if (this.rbTumble.isSameAs(var2)) {
- ServiceDialog.access$1200(this.this$0).add(Sides.TUMBLE);
- } else if (this.rbDuplex.isSameAs(var2)) {
- ServiceDialog.access$1200(this.this$0).add(Sides.DUPLEX);
- }
-
- }
-
- public void updateInfo() {
- Class var1 = Sides.class;
- boolean var2 = false;
- boolean var3 = false;
- boolean var4 = false;
- if (ServiceDialog.access$400(this.this$0).isAttributeCategorySupported(var1)) {
- Object var5 = ServiceDialog.access$400(this.this$0).getSupportedAttributeValues(var1, ServiceDialog.access$1600(this.this$0), ServiceDialog.access$1200(this.this$0));
- if (var5 instanceof Sides[]) {
- Sides[] var6 = (Sides[])var5;
-
- for(int var7 = 0; var7 < var6.length; ++var7) {
- Sides var8 = var6[var7];
- if (var8 == Sides.ONE_SIDED) {
- var2 = true;
- } else if (var8 == Sides.TUMBLE) {
- var3 = true;
- } else if (var8 == Sides.DUPLEX) {
- var4 = true;
- }
- }
- }
- }
-
- this.rbOneSide.setEnabled(var2);
- this.rbTumble.setEnabled(var3);
- this.rbDuplex.setEnabled(var4);
- Sides var9 = (Sides)ServiceDialog.access$1200(this.this$0).get(var1);
- if (var9 == null) {
- var9 = (Sides)ServiceDialog.access$400(this.this$0).getDefaultAttributeValue(var1);
- if (var9 == null) {
- var9 = Sides.ONE_SIDED;
- }
- }
-
- if (var9 == Sides.ONE_SIDED) {
- this.rbOneSide.setSelected(true);
- } else if (var9 == Sides.TUMBLE) {
- this.rbTumble.setSelected(true);
- } else {
- this.rbDuplex.setSelected(true);
- }
-
- }
- }
-